<?php

final class GerenciaGestao{
	
	private $objectGestao;
	private $sqlGestao;
	private $conexao;
	
	public function __construct(ConectaMysql $conexao){		
		$this->conexao = $conexao;
	}

	public function insertGestao(Gestao $objectGestao){
        $this->objectGestao = $objectGestao;
		
		$this->sqlGestao = "INSERT INTO tb_gestao(`GEST_HELPid`,`GEST_SITid`,`GESTdatainicial`)
							VALUES ('".($this->objectGestao->getHelpId())."',
							'".($this->objectGestao->getSITid())."',NOW())";
				
        $this->conexao->executaQuery($this->sqlGestao);

	}
	
	
	public function updateGestao(Gestao $objectGestao){
        $this->objectGestao = $objectGestao;
		$this->sqlGestao = "UPDATE tb_gestao 
							SET GEST_SITid = '".$this->objectGestao->getSITid()."', GESTdatafinal =  NOW()  
							WHERE (GEST_HELPid = '".($this->objectGestao->getHelpId())."')";
		
		$this->conexao->executaQuery($this->sqlGestao);

	}
	
	
	
}
?>